﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JHSoft.Extension
{
    public static class IntExtension
    {
        public static bool IsInt(this string s)
        {
            int i;
            return int.TryParse(s, out i);
        }

        public static int ToInt(this string s)
        {
            return int.Parse(s);
        }
        //示例：
        //public static void Test4()
        //{
        //    string s = "615";
        //    int i = 0;
        //    if (s.IsInt()) i = s.ToInt();
        //}
    }
}
